package com.mao.utils.number;

/**
 * 类注释
 *
 * @author maorui
 * @date Created in 2023/10/27 10:29
 **/
public class numUtils {
    /**
     * 获取num的每一位的数字
     */
    public static int[] getDigits(int num) {
        String numStr = Integer.toString(num);
        int[] digits = new int[numStr.length()];
        for (int i = 0; i < numStr.length(); i++) {
            digits[i] = Character.getNumericValue(numStr.charAt(i));
        }
        return digits;
    }
}
